﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="UserActivityLog.aspx.cs" Inherits="UserActivityLog" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
     <style>
        /* 容器样式 */
        .container {
            width: 70%;
            margin: auto;
            padding: 20px;
            background-color: #f4f2f9;
            border-radius: 12px;
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
            margin-top: 30px;
        }

        /* 标题样式 */
        .header-title {
            font-size: 26px;
            color: #5a3e85;
            text-align: center;
            margin-bottom: 20px;
            font-weight: bold;
        }

        /* 表格样式 */
        .styled-gridview {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            background-color: #ffffff;
        }

        /* 表头样式 */
        .styled-gridview th {
            background: linear-gradient(90deg, #7e57c2, #5a3e85);
            color: #ffffff;
            padding: 14px;
            text-align: center;
            font-size: 16px;
        }

        /* 表格行样式 */
        .styled-gridview td {
            padding: 12px;
            text-align: center;
            border-bottom: 1px solid #e0e0e0;
            font-size: 14px;
            color: #333;
        }

        /* 偶数行的背景颜色 */
        .styled-gridview tr:nth-child(even) {
            background-color: #f4f2f9;
        }

        /* 鼠标悬停效果 */
        .styled-gridview tr:hover {
            background-color: #e0daf5;
        }

        /* 审核按钮样式 */
        .approve-btn {
            background: linear-gradient(90deg, #4caf50, #388e3c);
            color: #ffffff;
            border: none;
            padding: 12px 24px;
            font-size: 16px;
            cursor: pointer;
            border-radius: 6px;
            transition: all 0.3s;
            box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
            display: block;
            width: 150px;
            margin: 20px auto;
            text-align: center;
        }

        .approve-btn:hover {
            background: linear-gradient(90deg, #388e3c, #2e7d32);
            box-shadow: 0 4px 10px rgba(40, 167, 69, 0.5);
        }

        /* 消息标签样式 */
        .message {
            text-align: center;
            font-size: 16px;
            color: #5a3e85;
            margin-top: 20px;
            display: block;
        }
        /* 筛选容器样式 */
        .filter-container {
            display: flex;
            align-items: center;
            gap: 10px;
            background-color: #f4f2f9;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
            width: fit-content;
            margin: 20px auto;
        }

        /* 输入框样式 */
        .filter-input {
            padding: 10px;
            font-size: 16px;
            border-radius: 6px;
            border: 1px solid #ccc;
            width: 200px;
            transition: border-color 0.3s ease;
        }

        .filter-input:focus {
            border-color: #7e57c2;
            outline: none;
        }

        /* 按钮样式 */
        .filter-button {
            padding: 10px 20px;
            font-size: 16px;
            color: #fff;
            background-color: #7e57c2;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: background-color 0.3s ease;
            box-shadow: 0 4px 8px rgba(126, 87, 194, 0.3);
        }

        .filter-button:hover {
            background-color: #5a3e85;
            box-shadow: 0 4px 12px rgba(90, 62, 133, 0.4);
        }

         /* 设置表格容器的样式 */
  /* 外部容器样式 */
.table-container {
    margin: 20px auto;
    width: 90%;
    background-color: #f4f2f9;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* GridView 表格样式 */
.styled-gridview {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-align: left;
}

.styled-gridview th {
    background-color: #6c63ff;
    color: #ffffff;
    padding: 10px;
    border: 1px solid #ddd;
    font-weight: bold;
}

.styled-gridview td {
    padding: 10px;
    border: 1px solid #ddd;
    color: #333;
}

.styled-gridview tr:nth-child(even) {
    background-color: #f9f9f9;
}

.styled-gridview tr:hover {
    background-color: #f1f1f1;
}

    </style>

   

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
     <div class="container">
        <h2 class="header-title">用户绑定审核</h2>

        <!-- GridView展示待审核的绑定请求 -->
        <asp:GridView ID="gvRequests" runat="server" CssClass="styled-gridview" AutoGenerateColumns="False" AllowPaging="True" PageSize="10" DataKeyNames="子女id,老人id">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:CheckBox ID="cbSelectAll" runat="server" OnCheckedChanged="cbSelectAll_CheckedChanged" AutoPostBack="true" CssClass="cbSelect" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="cbSelect" runat="server" CssClass="cbSelect" />
                    </ItemTemplate>
                </asp:TemplateField>
                
                <asp:BoundField DataField="子女id" HeaderText="子女ID" />
                <asp:BoundField DataField="老人id" HeaderText="老人ID" />
                <asp:BoundField DataField="绑定时间" HeaderText="绑定时间" />
            </Columns>
        </asp:GridView>

        <!-- 审核按钮 -->
        <asp:Button ID="btnApprove" runat="server" Text="审核通过" CssClass="approve-btn" OnClick="btnApprove_Click" />

        <!-- 消息标签 -->
        <asp:Label ID="lblMessage" runat="server" CssClass="message"></asp:Label>
    </div>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <div class="filter-container">
        <asp:TextBox ID="txtUserId" runat="server" CssClass="filter-input" placeholder="用户ID" />
        <asp:TextBox ID="txtAction" runat="server" CssClass="filter-input" placeholder="操作内容" />
        <asp:Button ID="btnFilter" runat="server" CssClass="filter-button" Text="筛选" OnClick="filterRecords" />
        <asp:Button ID="btnShowAll" runat="server" Text="显示全部" CssClass="filter-button" OnClick="btnShowAll_Click" />

    </div>

   <div class="table-container">
    <asp:GridView ID="gvUserActivityLog" runat="server" AutoGenerateColumns="false" CssClass="styled-gridview">
        <Columns>
            <asp:BoundField DataField="LogId" HeaderText="日志ID" />
            <asp:BoundField DataField="UserId" HeaderText="用户ID" />
            <asp:BoundField DataField="UserType" HeaderText="用户类型" />
            <asp:BoundField DataField="Action" HeaderText="操作内容" />
            <asp:BoundField DataField="Timestamp" HeaderText="操作时间" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}" />
            <asp:BoundField DataField="IPAddress" HeaderText="IP地址" />
        </Columns>
    </asp:GridView>
</div>

       
</asp:Content>

